<?php

	include "kernel.php";
    include "adw_functions.php";

    if ($_POST[dopost]) {

        $file = $_FILES[ffile];

        $strs = file($file[tmp_name]);

        $c = count($strs)-1;
        for ($i=1; $i<=$c; $i++) {

            $str = $strs[$i];
        	$str = ereg_replace("\r","",$str);
        	$str = ereg_replace("\n","",$str);

        	$str = explode(" ",$str);

 			$ilname = $str[0];
            $realname = $str[1];


			mysql_query("update aircrafts set il2name='$ilname' where realname='$realname'");
            echo "update aircrafts set il2name='$ilname' where realname='$realname'<br>\r\n";
        }

    }

?>

	<form method=post enctype="multipart/form-data">

    <input type=file name=ffile>

	<input type=submit name=dopost value="Add">


	</form>